<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: BonnMotionFileCache Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00037.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-types">Protected Types</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pro-static-attribs">Static Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">BonnMotionFileCache Class Reference<div class="ingroups"><a class="el" href="a00513.html">mobility - modules handling the mobility of the hosts</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="BonnMotionFileCache" -->
<p><code>#include &lt;<a class="el" href="a00337_source.html">BonnMotionFileCache.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for BonnMotionFileCache:</div>
<div class="dyncontent">
<div class="center"><img src="a00616.png" border="0" usemap="#BonnMotionFileCache_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a00617.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual const <a class="el" href="a00036.html">BonnMotionFile</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00037.html#acd2a73b9199e01b31db26ec817604b8b">getFile</a> (const char *filename)</td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="a00037.html">BonnMotionFileCache</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00037.html#a995dc4f97f699bb7a7361120f5cb46b1">getInstance</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00037.html#a8eda04da33078a95b2971e2c429969e9">deleteInstance</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pro-types"></a>
Protected Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac750dfb8bf1a24c281a65d3f8604fa69"></a><!-- doxytag: member="BonnMotionFileCache::BMFileMap" ref="ac750dfb8bf1a24c281a65d3f8604fa69" args="" -->
typedef std::map&lt; std::string, <br class="typebreak"/>
<a class="el" href="a00036.html">BonnMotionFile</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>BMFileMap</b></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a419bd9e8bbf1b82de00d37f69d289257"></a><!-- doxytag: member="BonnMotionFileCache::parseFile" ref="a419bd9e8bbf1b82de00d37f69d289257" args="(const char *filename, BonnMotionFile &amp;bmFile)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>parseFile</b> (const char *filename, <a class="el" href="a00036.html">BonnMotionFile</a> &amp;bmFile)</td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a97929fd681c1e9f2aa8d5269d47655fb"></a><!-- doxytag: member="BonnMotionFileCache::cache" ref="a97929fd681c1e9f2aa8d5269d47655fb" args="" -->
BMFileMap&#160;</td><td class="memItemRight" valign="bottom"><b>cache</b></td></tr>
<tr><td colspan="2"><h2><a name="pro-static-attribs"></a>
Static Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5afb0e0b1382039314aee521db870412"></a><!-- doxytag: member="BonnMotionFileCache::inst" ref="a5afb0e0b1382039314aee521db870412" args="" -->
static <a class="el" href="a00037.html">BonnMotionFileCache</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>inst</b></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Singleton object to read and store BonnMotion files. Used within <a class="el" href="a00038.html" title="Uses the BonnMotion native file format. See NED file for more info.">BonnMotionMobility</a>. Needed because otherwise every node would have to open and read the file independently.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Andras Varga </dd></dl>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a8eda04da33078a95b2971e2c429969e9"></a><!-- doxytag: member="BonnMotionFileCache::deleteInstance" ref="a8eda04da33078a95b2971e2c429969e9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BonnMotionFileCache::deleteInstance </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Deletes the singleton instance. </p>
<div class="fragment"><pre class="fragment">{
    <span class="keywordflow">if</span> (inst)
    {
        <span class="keyword">delete</span> inst;
        inst = NULL;
    }
}
</pre></div>
</div>
</div>
<a class="anchor" id="acd2a73b9199e01b31db26ec817604b8b"></a><!-- doxytag: member="BonnMotionFileCache::getFile" ref="acd2a73b9199e01b31db26ec817604b8b" args="(const char *filename)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="a00036.html">BonnMotionFile</a> * BonnMotionFileCache::getFile </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filename</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the given document. </p>

<p>Referenced by <a class="el" href="a00038.html#aefa1902bb0eb0797092868ed523c1327">BonnMotionMobility::initialize()</a>.</p>
<div class="fragment"><pre class="fragment">{
    <span class="comment">// if found, return it from cache</span>
    BMFileMap::iterator it = cache.find(std::string(filename));
    <span class="keywordflow">if</span> (it!=cache.end())
        <span class="keywordflow">return</span> &amp;(it-&gt;second);

    <span class="comment">// load and store in cache</span>
    <a class="code" href="a00036.html">BonnMotionFile</a>&amp; bmFile = cache[filename];
    parseFile(filename, bmFile);
    <span class="keywordflow">return</span> &amp;bmFile;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a995dc4f97f699bb7a7361120f5cb46b1"></a><!-- doxytag: member="BonnMotionFileCache::getInstance" ref="a995dc4f97f699bb7a7361120f5cb46b1" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00037.html">BonnMotionFileCache</a> * BonnMotionFileCache::getInstance </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the singleton instance. </p>

<p>Referenced by <a class="el" href="a00038.html#aefa1902bb0eb0797092868ed523c1327">BonnMotionMobility::initialize()</a>.</p>
<div class="fragment"><pre class="fragment">{
    <span class="keywordflow">if</span> (!inst)
        inst = <span class="keyword">new</span> <a class="code" href="a00037.html">BonnMotionFileCache</a>;
    <span class="keywordflow">return</span> inst;
}
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/inet_stub/mobility/models/<a class="el" href="a00337_source.html">BonnMotionFileCache.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/inet_stub/mobility/models/BonnMotionFileCache.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00037.html">BonnMotionFileCache</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:31 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
